<?php

ini_set('display_errors', 1);
require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\model\brand\Brand;


$brandId = $argv[1] ?? 0;
$dayCount = $argv[2] ?? 7;
$where = $brandId ? ['id' => $brandId] : [];
$where += ['status' => Brand::STATUS_USING, 'package_id[>]' => 0, 'brand_type[!]' => Brand::BRAND_TYPE_EXPIRE];
$list = Brand::select('*', $where);

$brand_ids = array_column($list, 'id');
$map = array_column($list, null, 'id');
\Biz\service\brand\BrandGrowth::lostNotice($brand_ids, $map, $dayCount);
